#if !defined(AFX_FUNCTION_H__B5CB82D6_709F_405B_B0BC_89AF6AB981AD__INCLUDED_)
#define AFX_FUNCTION_H__B5CB82D6_709F_405B_B0BC_89AF6AB981AD__INCLUDED_
//#include "CardReaderInterface.h"
CString _memcpy(LPCTSTR src, LPCTSTR off, LPCTSTR len);
CString intToHexStr(unsigned int num);
CString _memcmp(LPCTSTR data1, LPCTSTR data2, LPCTSTR len);
CString _sizeof(LPCTSTR data);
CString _leftformat(LPCTSTR src, LPCTSTR formatLen);
CString _leftXorRight8(LPCTSTR src);
CString _rightformat(LPCTSTR src, LPCTSTR formatLen);
CString _strtoascii(LPCTSTR src);
CString _asciitostr(LPCTSTR src);
CString _strtohex(LPCTSTR src);
CString _hextostr(LPCTSTR src);
// string function
CString _strmid(LPCTSTR src, LPCTSTR off, LPCTSTR len);
CString _strlen(LPCTSTR src);
CString _strset(LPCTSTR src, LPCTSTR onech);
CString _left(LPCTSTR src, LPCTSTR len);
CString _right(LPCTSTR src, LPCTSTR len);
CString _strcopy(LPCTSTR src, LPCTSTR off, LPCTSTR len);
CString _strcmp(LPCTSTR data1, LPCTSTR data2, LPCTSTR off, LPCTSTR len);
CString _fs_pboc(LPCTSTR supKey, LPCTSTR geneData);
CString Tag(CString DataLine,CString Biaozhi,int part);
CString _xor(LPCTSTR key);
int strAscToStrHex(const unsigned char *src, int srcLen, char *dest);
int hexStrToHexBuf(const char *src, int srcLen, unsigned char *dest);
int hexBufToHexStr(const unsigned char *src, int srcLen, char * dest);
int strCompareExp(LPCTSTR src1, LPCTSTR src2);
void getTime(char * dest);
#endif // !defined(AFX_FUNCTION_H__B5CB82D6_709F_405B_B0BC_89AF6AB981AD__INCLUDED_)
// KeyHost.h: interface for the KeyHost class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_KEYHOST_H__F09E70CF_6683_44FF_AA3A_8A019B086F4F__INCLUDED_)
#define AFX_KEYHOST_H__F09E70CF_6683_44FF_AA3A_8A019B086F4F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxsock.h>
class KeyHost
{
public:
KeyHost();
KeyHost(LPCTSTR ip, unsigned int port);
// virtual ~KeyHost();
int hostConnect();
int disConnect();
int sendData(LPCTSTR cmd);
CString getResp();
int getKeyHostStatus();
CString getBankNum(CString Resp);
protected:
unsigned char m_RespBuf[2048];
int m_Status;
SOCKET m_Socket;
LPCTSTR m_IP;
unsigned int m_Port;
unsigned char m_tmpbuf[2048];
bool m_isRecieved;
};
#endif // !defined(AFX_KEYHOST_H__F09E70CF_6683_44FF_AA3A_8A019B086F4F__INCLUDED_)
评论